const Sequelize = require('sequelize');
module.exports = function(sequelize, DataTypes) {
  return sequelize.define('base_complete_check_master', {
    id: {
      autoIncrement: true,
      type: DataTypes.BIGINT,
      allowNull: false,
      primaryKey: true,
      comment: "唯一标识"
    },
    messageId: {
      type: DataTypes.STRING(64),
      allowNull: true,
      comment: "原信息ID",
      field: 'message_id'
    },
    prjName: {
      type: DataTypes.STRING(255),
      allowNull: true,
      comment: "项目名称",
      field: 'prj_name'
    },
    prjNum: {
      type: DataTypes.STRING(255),
      allowNull: true,
      comment: "所属项目id",
      field: 'prj_num'
    },
    singleProjName: {
      type: DataTypes.STRING(255),
      allowNull: true,
      comment: "工程名称",
      field: 'single_proj_name'
    },
    singleProjNum: {
      type: DataTypes.STRING(255),
      allowNull: true,
      comment: "单体编号",
      field: 'single_proj_num'
    },
    projectName: {
      type: DataTypes.STRING(200),
      allowNull: true,
      comment: "项目名称",
      field: 'project_name'
    },
    prjAddress: {
      type: DataTypes.STRING(255),
      allowNull: true,
      comment: "工程地址",
      field: 'prj_address'
    },
    handlingPerson: {
      type: DataTypes.STRING(255),
      allowNull: true,
      comment: "经办人",
      field: 'handling_person'
    },
    factArea: {
      type: DataTypes.STRING(255),
      allowNull: true,
      comment: "规划核实总面积",
      field: 'fact_area'
    },
    upperFactArea: {
      type: DataTypes.STRING(255),
      allowNull: true,
      comment: "规划核实地上面积",
      field: 'upper_fact_area'
    },
    underFactArea: {
      type: DataTypes.STRING(255),
      allowNull: true,
      comment: "规划核实地下面积",
      field: 'under_fact_area'
    },
    auditArea: {
      type: DataTypes.STRING(255),
      allowNull: true,
      comment: "图审总面积",
      field: 'audit_area'
    },
    upperArea: {
      type: DataTypes.STRING(255),
      allowNull: true,
      comment: "图审地上面积",
      field: 'upper_area'
    },
    underArea: {
      type: DataTypes.STRING(255),
      allowNull: true,
      comment: "图审地下面积",
      field: 'under_area'
    },
    bulidArea: {
      type: DataTypes.STRING(255),
      allowNull: true,
      comment: "消防总面积",
      field: 'bulid_area'
    },
    upperBulidArea: {
      type: DataTypes.STRING(255),
      allowNull: true,
      comment: "消防地上面积",
      field: 'upper_bulid_area'
    },
    underBuildArea: {
      type: DataTypes.STRING(255),
      allowNull: true,
      comment: "消防地下面积",
      field: 'under_build_area'
    },
    buildCorpName: {
      type: DataTypes.STRING(255),
      allowNull: true,
      comment: "建设单位名称",
      field: 'build_corp_name'
    },
    buildCorpCode: {
      type: DataTypes.STRING(255),
      allowNull: true,
      comment: "建设单位组织机构代码",
      field: 'build_corp_code'
    },
    prjSendDate: {
      type: DataTypes.STRING(255),
      allowNull: true,
      comment: "办结时间",
      field: 'prj_send_date'
    },
    status: {
      type: DataTypes.STRING(255),
      allowNull: true,
      comment: "状态"
    },
    screatetime: {
      type: DataTypes.DATE,
      allowNull: true,
      comment: "创建时间"
    },
    slastUpdatetime: {
      type: DataTypes.DATE,
      allowNull: true,
      comment: "上次更新时间",
      field: 'slast_updatetime'
    },
    gcyt: {
      type: DataTypes.STRING(255),
      allowNull: true
    },
    xiaqu: {
      type: DataTypes.STRING(255),
      allowNull: true,
      comment: "辖区"
    },
    structSysCode: {
      type: DataTypes.STRING(255),
      allowNull: true,
      comment: "结构类型",
      field: 'struct_sys_code'
    },
    layerNum: {
      type: DataTypes.STRING(255),
      allowNull: true,
      comment: "层数",
      field: 'layer_num'
    },
    bdate: {
      type: DataTypes.STRING(32),
      allowNull: true,
      comment: "开工日期"
    },
    edate: {
      type: DataTypes.STRING(32),
      allowNull: true,
      comment: "竣工验收日期"
    },
    factLicenceNum: {
      type: DataTypes.STRING(255),
      allowNull: true,
      comment: "规划许可证号",
      field: 'fact_licence_num'
    },
    builderLicenceNum: {
      type: DataTypes.STRING(255),
      allowNull: true,
      comment: "施工许可证号",
      field: 'builder_licence_num'
    },
    builderOpinion: {
      type: DataTypes.STRING(500),
      allowNull: true,
      comment: "施工图审意见",
      field: 'builder_opinion'
    },
    id1: {
      type: DataTypes.STRING(255),
      allowNull: true,
      comment: "原ID",
      field: 'ID1'
    },
    isDeleted: {
      type: DataTypes.CHAR(1),
      allowNull: true,
      comment: "1=已删除 0=未删除",
      field: 'is_deleted'
    },
    createdUser: {
      type: DataTypes.BIGINT,
      allowNull: true,
      comment: "创建人",
      field: 'created_user'
    },
    createdTime: {
      type: DataTypes.DATE,
      allowNull: true,
      comment: "本系统创建时间",
      field: 'created_time'
    },
    updatedUser: {
      type: DataTypes.BIGINT,
      allowNull: true,
      comment: "修改人",
      field: 'updated_user'
    },
    updatedTime: {
      type: DataTypes.DATE,
      allowNull: true,
      comment: "修改时间",
      field: 'updated_time'
    }
  }, {
    sequelize,
    tableName: 'base_complete_check_master',
    timestamps: false,
    indexes: [
      {
        name: "PRIMARY",
        unique: true,
        using: "BTREE",
        fields: [
          { name: "id" },
        ]
      },
    ]
  });
};
